<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@ page import="com.four.Mybatis.Bean.User" %>
<%@ page import="java.io.PrintWriter" %>
<%@ page import="com.four.Mybatis.Bean.Admin" %>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <base href="<%=basePath%>">
    
    <title>洗衣店管理系统</title>
    
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
	<meta http-equiv="description" content="This is my page">
<link rel="stylesheet" type="text/css" href="CSS/Login.css">
<style type="text/css">
<!--
body{
	background-image: url("Image/1.jpg");
	background-size:100%  100%;
	
}
-->
</style>
<script language="JavaScript">
function login()
{	
	var pattern = /^[a-zA-Z0-9]+$/;
	if (document.form1.name.value == "" ) 
	{
		alert("请输入用户名!");
		document.form1.name.focus();
		return false;
	}
	if (!pattern.test(document.form1.name.value) )  
	{
		alert("用户名只能包含字母、数字!");
		document.form1.name.focus();
		return false;
	}
	if (document.form1.pwd.value == ""  )  
	{
		alert("请输入密码!");
		document.form1.pwd.focus();
		return false;
	}
	if (!pattern.test(document.form1.pwd.value) )  
	{
		alert("密码只能包含字母、数字!");
		document.form1.pwd.focus();
		return false;
	}
}
</script>
</head>
  
<body>
	<div class = "login">
    	<h3>登录-洗衣店</h3>
    	<form action = "LoginCheck" name ="form1" method = "post" onSubmit="return login()">
    		<div class = "username">
    			用户名:<br/><input type ="text" name = "name" value="four">
		    </div>
		    <div class = "password">
		    	密码:<br/><input type ="password" name = "pwd" value="12345">
		    </div>
		     <div class = "Character">
		    	<input type ="radio" name = "char" value="User" checked>员工
				<input type ="radio" name = "char" value="Manager">管理员
		    </div>
		    <div class = "btn">
		    	<input type = "submit" value = "登陆">
				<br/><span style="color: red;">${msg}</span>
		    </div>
     	</form>   	
     	<p>&nbsp;&nbsp;&nbsp;点击<a href="Register.jsp">这</a>注册！</p>
    </div>
</body>
  <%
      User user= (User) session.getAttribute("User");
      if(user!=null){
          session.removeAttribute("user");
      }
  %>

  <%
	  Admin admin= (Admin) session.getAttribute("Admin");
	  if(admin!=null){
		  session.removeAttribute("Admin");
	  }
  %>


</html>

